package com.example.chapter03;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class TextViewActivity extends AppCompatActivity {
    @SuppressLint("ResourceAsColor")
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_view);

        TextView textView = findViewById(R.id.text_view);
        textView.setText("Hello, Android!");
        textView.setBackgroundColor(Color.BLUE);

        TextView textView1 = findViewById(R.id.text_view1);
        textView1.setText(R.string.text_view_value1);
        textView1.setTextColor(0xff00ff00);

        TextView text_size = findViewById(R.id.text_size);
        text_size.setText(R.string.text_view_value2);
        text_size.setTextSize(30);
        text_size.setBackgroundColor(R.color.teal_200);
    }
}
